// import { process_params } from "express/lib/router"

// pages/orderSuccess/orderSuccess.js

Page({

    /**
     * 页面的初始数据
     */
    data: {
       
           phone:'',
           orderId:''
         
    },
    onLoad:function(params){
        console.log(params)
       this.setData({
           phone:params.phone,
           orderId:params.orderId
       })
    },
    onShow(){
      wx.showLoading({
        title: '预订中',
        mask:true
      });
      setTimeout(() => {
        
        wx.hideLoading()
       
     
      }, 1000);
    },
    // 获取联系方式
    getPhone(){
        wx.showModal({
            title: '卖家联系方式',
            content: this.data.phone,
            confirmText:'复制',
            success: (res)=> {   
              if (res.confirm) {
                console.log('用户点击确定')
                wx.setClipboardData({
                    data: this.data.phone,
                    success (res) {
                      wx.getClipboardData({
                        success (res) {
                          console.log(res) // data
                        }
                      })
                    }
                  })
              } else if (res.cancel) {
                console.log('用户点击取消')
              }
            }
          })
    },
   
    // 继续购物
    continueBuy(){
        wx.switchTab({
            url:'/pages/index/index',
        });
         
    },
    //查看订单详情
    toOrderDetail(){
        wx.navigateTo({
            url:'/pages/orderDetail/orderDetail?orderId='+this.data.orderId
        })
    }
   
})